home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEM
/
S-Z
/
Special Delivery™ Demo.cpt
/
Special Delivery™ Demo
/
Claris
/
Claris Translators
/
EPSF.rsrc
/
PS_113
< prev
next >
Wrap
Text File
|
1991-06-19
|
3KB
|
115 lines
%%BeginProcSet : RGB4toGray4
/redTbl4 [0 0 1 1 1 1 2 2 3 3 3 4 4 4 5 5] def
/greenTbl4 [0 1 1 2 2 3 3 4 4 5 6 6 7 7 7 8] def
/blueTbl4 [0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2] def
/RGB4toGray4 {
currentfile RGBBuf readhexstring pop pop
/i 0 def
/j 0 def
grayBuf length {
RGBBuf i get dup
-4 bitshift redTbl4 exch get
exch 15 and greenTbl4 exch get add
RGBBuf i 1 add get dup
-4 bitshift blueTbl4 exch get 3 -1 roll add 4 bitshift
exch 15 and redTbl4 exch get
RGBBuf i 2 add get dup
-4 bitshift greenTbl4 exch get 3 -1 roll add
exch 15 and blueTbl4 exch get add or
grayBuf j 3 -1 roll put
/i i 3 add def
/j j 1 add def
} repeat
grayBuf
} bind def
%%EndProcSet
%%BeginProcSet : RGB8toGray8
/RGB8toGray8 {
currentfile RGBBuf readhexstring pop pop
/i 0 def
/j 0 def
grayBuf length {
RGBBuf i get 0.33 mul
RGBBuf i 1 add get 0.55 mul add
RGBBuf i 2 add get 0.12 mul add round cvi
grayBuf j 3 -1 roll put
/i i 3 add def
/j j 1 add def
} repeat
grayBuf
} bind def
%%EndProcSet
%%BeginProcSet : RGB24toGray8
/RGB24toGray8 {RGB8toGray8} bind def
%%EndProcSet
%%BeginProcSet : RGB2toGray2
/redTbl2 [0 0 1 1] def
/greenTbl2 [0 1 1 2] def
/blueTbl2 [0 0 0 0] def
/RGB2toGray2 {
currentfile RGBBuf readhexstring pop pop
/i 0 def
/j 0 def
grayBuf length {
RGBBuf i get dup dup dup
-6 bitshift redTbl2 exch get
exch -4 bitshift 3 and
greenTbl2 exch get add
exch -2 bitshift 3 and
blueTbl2 exch get add
6 bitshift exch 3 and
redTbl2 exch get
RGBBuf i 1 add get dup dup dup
-6 bitshift greenTbl2 exch get
exch -4 bitshift 3 and
blueTbl2 exch get add
4 -1 roll add
4 bitshift 4 -1 roll or
3 1 roll -2 bitshift 3 and
redTbl2 exch get exch 3 and
greenTbl2 exch get add
RGBBuf i 2 add get dup dup dup
-6 bitshift blueTbl2 exch get
5 -1 roll add
2 bitshift 5 -1 roll or
4 1 roll -4 bitshift 3 and
redTbl2 exch get
exch -2 bitshift 3 and
greenTbl2 exch get add
exch 3 and
greenTbl2 exch get add or
grayBuf j 3 -1 roll put
/i i 3 add def
/j j 1 add def
} repeat
grayBuf
} bind def
%%EndProcSet
%%EndProcSet
%%BeginProcSet : RGB1toGray1
/RGB1toGray1 {
currentfile RGBBuf readhexstring pop pop
/i 0 def
/j 0 def
grayBuf length {
RGBBuf i get dup dup
1 bitshift 128 and exch
3 bitshift 64 and or exch
5 bitshift 32 and or
RGBBuf i 1 add get dup
-1 bitshift 16 and exch
1 bitshift 8 and or or
RGBBuf i 2 add get dup dup
-5 bitshift 4 and exch
-3 bitshift 2 and or exch
-1 bitshift 1 and or or
/i i 3 add def
/j j 1 add def
} repeat
grayBuf
} bind def
%%EndProcSet
%%BeginProcSet : RGB16toGray8
/RGB16toGray8 {RGB8toGray8} bind def
%%EndProcSet